package com.abigdreamer.im.client.util;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;

import javax.swing.ListCellRenderer;

import com.abigdreamer.im.client.resourse.ResourcesManagement;
import com.abigdreamer.im.client.ui.comboBox.ComplexJComboBoxRenderer;
import com.abigdreamer.im.client.ui.comboBox.JComboBoxItem;

import craky.componentc.JCComboBox;

public class ClientIMUtil {

	public static JCComboBox createIMStateCombox() {
		JComboBoxItem state_items[] = { new JComboBoxItem(new Font("Helvetica", Font.PLAIN, 10), Color.RED, ResourcesManagement.getImageIcon("ui/online.png", 16, 16), "上线"),
				new JComboBoxItem(new Font("Helvetica", Font.PLAIN, 10), Color.RED, ResourcesManagement.getImageIcon("ui/mang.png", 16, 16), "忙碌"),
				new JComboBoxItem(new Font("Helvetica", Font.PLAIN, 10), Color.RED, ResourcesManagement.getImageIcon("ui/jingyin.png", 16, 16), "静音"),
				new JComboBoxItem(new Font("Helvetica", Font.PLAIN, 10), Color.BLUE, ResourcesManagement.getImageIcon("ui/yingshen.png", 16, 16), "隐身") };
		JCComboBox state_ComboBox = new JCComboBox(state_items);
		ListCellRenderer<?> renderer = new ComplexJComboBoxRenderer(); // JComboBox的渲染器
		state_ComboBox.setRenderer(renderer);
		state_ComboBox.setPreferredSize(new Dimension(45, 22));
		return state_ComboBox;
	}
}
